import wtforms
from wtforms.validators import length, email, EqualTo



class RegisterForm(wtforms.Form):
    name = wtforms.StringField(validators=[length(min=1, max=20)])
    password = wtforms.StringField(validators=[length(min=1, max=20)])
    password_confirm = wtforms.StringField(validators=[EqualTo("password")])


class LoginForm(wtforms.Form):
    name = wtforms.StringField(validators=[length(min=1, max=20)])
    password = wtforms.StringField(validators=[length(min=1, max=20)])
    level = wtforms.StringField()

class BookForm(wtforms.Form):
    id = wtforms.StringField(validators=[length(min=1, max=20)])
    name = wtforms.StringField(validators=[length(min=1, max=20)])
    author = wtforms.StringField(validators=[length(min=1, max=20)])
    type = wtforms.StringField(validators=[length(min=1, max=20)])
    publish = wtforms.StringField(validators=[length(min=1, max=20)])
    publish_time = wtforms.IntegerField(validators=[])
    price = wtforms.IntegerField(validators=[])
    amount = wtforms.IntegerField(validators=[])




